import { Controller } from 'egg';

class ActivityController extends Controller {
    /**
     * 查找好友数量
     */
    public async searchFriends() {
        const { ctx, ctx: { request } } = this;
        try {
            ctx.validate({
                type: 'string',
                user_id: 'string',
            }, request.body)
        } catch (e) {
            ctx.body = ctx.helper.responseErrorParam(e.errors[0].message);
            return;
        }
        let result = await ctx.service.friendsService.searchFriends(request.body);
        ctx.body = ctx.helper.responseSuccess('查询成功', result);
    }
}
export default ActivityController;